﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class 采购订单和采购订单项 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            //migrationBuilder.CreateTable(
            //    name: "T_AdminConfiguration",
            //    columns: table => new
            //    {
            //        Id = table.Column<long>(type: "bigint", nullable: false),
            //        UserAccount = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        IsAdmin = table.Column<bool>(type: "bit", nullable: false),
            //        CreateUserId = table.Column<long>(type: "bigint", nullable: false),
            //        CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
            //        ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        IsDel = table.Column<bool>(type: "bit", nullable: false)
            //    },
            //    constraints: table =>
            //    {
            //        table.PrimaryKey("PK_T_AdminConfiguration", x => x.Id);
            //    });

            //migrationBuilder.CreateTable(
            //    name: "T_EquipmentBorrow",
            //    columns: table => new
            //    {
            //        Id = table.Column<long>(type: "bigint", nullable: false),
            //        Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        BorrowedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //        BorrowedName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        ReturnTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //        BorrowedReason = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        CreateUserId = table.Column<long>(type: "bigint", nullable: false),
            //        CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
            //        ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        IsDel = table.Column<bool>(type: "bit", nullable: false)
            //    },
            //    constraints: table =>
            //    {
            //        table.PrimaryKey("PK_T_EquipmentBorrow", x => x.Id);
            //    });

            //migrationBuilder.CreateTable(
            //    name: "T_EquipmentMaintenance",
            //    columns: table => new
            //    {
            //        Id = table.Column<long>(type: "bigint", nullable: false),
            //        Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        CustomerInfo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        DeviceInfo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        DeviceProcess = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        Part = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
            //        Cost = table.Column<double>(type: "float", nullable: false),
            //        CreateUserId = table.Column<long>(type: "bigint", nullable: false),
            //        CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
            //        ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        IsDel = table.Column<bool>(type: "bit", nullable: false)
            //    },
            //    constraints: table =>
            //    {
            //        table.PrimaryKey("PK_T_EquipmentMaintenance", x => x.Id);
            //    });

            //migrationBuilder.CreateTable(
            //    name: "T_EquipmentType",
            //    columns: table => new
            //    {
            //        Id = table.Column<long>(type: "bigint", nullable: false),
            //        TypeName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        TotalQuantity = table.Column<int>(type: "int", nullable: false),
            //        CreateUserId = table.Column<long>(type: "bigint", nullable: false),
            //        CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
            //        ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        IsDel = table.Column<bool>(type: "bit", nullable: false)
            //    },
            //    constraints: table =>
            //    {
            //        table.PrimaryKey("PK_T_EquipmentType", x => x.Id);
            //    });

            //migrationBuilder.CreateTable(
            //    name: "T_NetworkAddress",
            //    columns: table => new
            //    {
            //        Id = table.Column<long>(type: "bigint", nullable: false),
            //        NetAddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        TotalQuantity = table.Column<int>(type: "int", nullable: false),
            //        CreateUserId = table.Column<long>(type: "bigint", nullable: false),
            //        CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
            //        ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        IsDel = table.Column<bool>(type: "bit", nullable: false)
            //    },
            //    constraints: table =>
            //    {
            //        table.PrimaryKey("PK_T_NetworkAddress", x => x.Id);
            //    });

            migrationBuilder.CreateTable(
                name: "T_PurchaseOrder",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    PurchasePlanId = table.Column<int>(type: "int", nullable: false),
                    OrderNumber = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    OrderDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    TotalAmount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Status = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_PurchaseOrder", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_PurchaseOrderItem",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    PurchaseOrderId = table.Column<int>(type: "int", nullable: false),
                    ProductName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Quantity = table.Column<int>(type: "int", nullable: false),
                    UnitPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_PurchaseOrderItem", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "T_AdminConfiguration");

            migrationBuilder.DropTable(
                name: "T_EquipmentBorrow");

            migrationBuilder.DropTable(
                name: "T_EquipmentMaintenance");

            migrationBuilder.DropTable(
                name: "T_EquipmentType");

            migrationBuilder.DropTable(
                name: "T_NetworkAddress");

            migrationBuilder.DropTable(
                name: "T_PurchaseOrder");

            migrationBuilder.DropTable(
                name: "T_PurchaseOrderItem");
        }
    }
}
